import request from '@/utils/request'
import qs from 'qs'

export function queryList(params) {
  return request({
    url: '/api/labelInfo/queryList' + '?' + qs.stringify(params, { indices: false }),
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: '/api/labelInfo',
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: '/api/labelInfo',
    method: 'put',
    data
  })
}

export function del(data) {
  return request({
    url: '/api/labelInfo',
    method: 'delete',
    data
  })
}

export function enable(data) {
  return request({
    url: '/api/labelInfo/enable',
    method: 'put',
    data
  })
}

export function disable(data) {
  return request({
    url: '/api/labelInfo/disable',
    method: 'put',
    data
  })
}

export function checkLabelCode(params) {
  return request({
    url: '/api/labelInfo/checkLabelCode' + '?' + qs.stringify(params, { indices: false }),
    method: 'get'
  })
}


export default { add, edit, del, queryList, enable, disable, checkLabelCode }
